package cn.iocoder.yudao.module.project.dal.mysql.deliveryreceiptdetail;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.project.dal.dataobject.deliveryreceiptdetail.DeliveryReceiptDetailDO;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.project.controller.admin.deliveryreceiptdetail.vo.*;
import org.apache.ibatis.annotations.Param;

/**
 * 拨交单明细 Mapper
 *
 * @author 管理员
 */
@Mapper
public interface DeliveryReceiptDetailMapper extends BaseMapperX<DeliveryReceiptDetailDO> {

    default PageResult<DeliveryReceiptDetailDO> selectPage(DeliveryReceiptDetailPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<DeliveryReceiptDetailDO>()
                .eqIfPresent(DeliveryReceiptDetailDO::getDeliveryReceiptId, reqVO.getDeliveryReceiptId())
                .eqIfPresent(DeliveryReceiptDetailDO::getOrderId, reqVO.getOrderId())
                .eqIfPresent(DeliveryReceiptDetailDO::getInternalCode, reqVO.getInternalCode())
                .eqIfPresent(DeliveryReceiptDetailDO::getProductionCode, reqVO.getProductionCode())
                .eqIfPresent(DeliveryReceiptDetailDO::getType, reqVO.getType())
                .betweenIfPresent(DeliveryReceiptDetailDO::getLastCollectionTime, reqVO.getLastCollectionTime())
                .eqIfPresent(DeliveryReceiptDetailDO::getOutDeptId, reqVO.getOutDeptId())
                .likeIfPresent(DeliveryReceiptDetailDO::getOutDeptName, reqVO.getOutDeptName())
                .eqIfPresent(DeliveryReceiptDetailDO::getRecvDeptId, reqVO.getRecvDeptId())
                .likeIfPresent(DeliveryReceiptDetailDO::getRecvDeptName, reqVO.getRecvDeptName())
                .betweenIfPresent(DeliveryReceiptDetailDO::getSubmitTime, reqVO.getSubmitTime())
                .eqIfPresent(DeliveryReceiptDetailDO::getRemark, reqVO.getRemark())
                .betweenIfPresent(DeliveryReceiptDetailDO::getCreateTime, reqVO.getCreateTime())
                .orderByAsc(DeliveryReceiptDetailDO::getInternalCode));
    }

    List<DeliveryReceiptDetailDO> getReport(Page<DeliveryReceiptDetailPageReqVO> page, @Param("reqVO") DeliveryReceiptDetailPageReqVO pageReqVO);

    List<DeliveryReceiptDetailDO> selectPageList(Page<DeliveryReceiptDetailPageReqVO> page, @Param("reqVO") DeliveryReceiptDetailPageReqVO pageReqVO);

    List<DeliveryReceiptSummaryRespVO> getDeliveryReceiptSummaryReport(Page<DeliveryReceiptDetailPageReqVO> page, @Param("reqVO") DeliveryReceiptDetailPageReqVO pageReqVO);

}